package com.ivc.info.action;

import java.util.List;

import javax.annotation.Resource;

import com.cs.framework.ui.bo.UIData;
import com.cs.framework.ui.web.UI;
import com.cs.framework.web.annotation.Action;
import com.cs.framework.web.annotation.Mapping;
import com.cs.framework.web.handler.Web;
import com.ivc.info.dto.base.StockInfoDto;
import com.ivc.info.service.StockInfoService;

/**
 * 库存
 * 
 * @author hedongzhou
 * 
 */
@Action("stockInfo")
public class StockInfoAction {

	@Resource
	private StockInfoService stockInfoService;

	/**
	 * 进入库存管理页面
	 */
	@Mapping
	public void mainPage() {
		UI.returnPage("info_sti");
	}

	/**
	 * 查询库存
	 */
	@Mapping
	public Object query() {
		StockInfoDto stockInfoDto = Web.bind(StockInfoDto.class);

		List<StockInfoDto> list = stockInfoService.query(stockInfoDto);
		int count = stockInfoService.count(stockInfoDto);

		return new UIData(list, count);
	}

}
